package com.block.datapush.special.api.utils;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import com.block.db.entity.MemberExtInfo;

public class BoNaJinXiUtil {

    public static Integer getAmount(String amount){
        BaseTypeInfoEnum.LoanAmount entryByValue = BaseTypeInfoEnum.LoanAmount.getEntryByValue(amount);
        if (ObjectUtil.isNotEmpty(entryByValue)){
            return entryByValue.getAmount().intValue()/10000;
        }
        return 1;
    }

    public static Integer getSheBao(String socialInsurance) {
        if (StrUtil.equals(socialInsurance, BaseTypeInfoEnum.SocialInsurance.si002.getValue())){
            return 1;
        }
        return 0;
    }

    public static Integer getGjj(String gjj) {
        if (StrUtil.equals(gjj, BaseTypeInfoEnum.Gjj.gjj002.getValue())){
            return 1;
        }
        return 0;
    }

    public static Integer job(String entrepreneur) {
        if (StrUtil.equals(entrepreneur, BaseTypeInfoEnum.Job.job002.getValue())){
            return 1;
        }
        return 0;
    }

    public static Integer getCar(String car) {
        if (StrUtil.equals(car, BaseTypeInfoEnum.House.hu002.getValue())){
            return 1;
        }
        return 0;
    }

    public static Integer getHouse(String house) {
        if (StrUtil.equals(house, BaseTypeInfoEnum.House.hu002.getValue())){
            return 1;
        }
        return 0;
    }

    public static Integer getBaoDan(String insurance) {
        if (StrUtil.equals(insurance, BaseTypeInfoEnum.Insurance.in002.getValue())){
            return 1;
        }
        return 0;
    }
    public static String getyuqi(String yuqi) {
        if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq001.getValue())){
            return "有逾期";
        }
        return "无逾期";
    }

    public static String getZhiMa(String zhimaScore) {
        if (StrUtil.equals(zhimaScore, BaseTypeInfoEnum.ZhimaScore.zm002.getValue())){
            return "599";
        }else if (StrUtil.equals(zhimaScore, BaseTypeInfoEnum.ZhimaScore.zm003.getValue())){
            return "649";
        }else if (StrUtil.equals(zhimaScore, BaseTypeInfoEnum.ZhimaScore.zm004.getValue())){
            return "699";
        }else if (StrUtil.equals(zhimaScore, BaseTypeInfoEnum.ZhimaScore.zm005.getValue())){
            return "750";
        }
        return "0";
    }
}
